package com.vf.admin.client.controller;

import com.vf.admin.client.common.ClientBaseController;
import com.vf.admin.client.service.AppOpLogService;
import com.vf.admin.common.db.annotation.Column;
import com.vf.admin.common.entity.Result;
import com.vf.admin.miaodong.entity.AppOpLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/8/12 17:54
 */
@Controller
@RequestMapping("/app/opLog")
public class AppOpLogController extends ClientBaseController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private AppOpLogService appOpLogService;


    @RequestMapping("/upOpLog")
    @ResponseBody
    public Result upOpLog(AppOpLog param) {

        try {
            param.setCreateTime(new Date());
            appOpLogService.save(param);
            return this.sucessJSON("保存成功");
        }catch (Exception e){
            logger.error("上传异常", e);
            return this.errorJSON("系统繁忙");
        }
    }
}
